const Koa=require('koa');
const app=new Koa();

app.use(async ctx=>{
    if('/index'===ctx.url){
        ctx.cookies.set('cid','Hello Koa!!',{
           domain:'localhost',
           path:'/index',
           maxAge:1000*60*10,
           expries:new Date(Date.now()+1000*3600*24),
           httpOnly:false,
           overwrite:false
        });
        ctx.body='Cookie is ok!!';
    }else{
        ctx.body='Hello Koa!!';
    }
});

app.listen(4000,()=>{
    console.log('StaticServer port:4000----'+new Date().toLocaleTimeString());
});